package com.nl.lib_core.tool.coroutines

import com.nl.lib_core.tool.coroutines.exception.CaughtCoroutineExceptionHandler
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob

/** 作者: wangfei 创建时间: 2021/12/27 包名: com.nl.lib_core.tool.coroutines 类名: GeneralCoroutineScope */
class GeneralCoroutineScope(
    context: CoroutineContext,
    listener: CoroutineExceptionListener? = null
) : CoroutineScope {
  override val coroutineContext: CoroutineContext =
      SupervisorJob() + context + CaughtCoroutineExceptionHandler(listener)
}
